package com.mycompany.myapp.service.mapper;

import com.mycompany.myapp.domain.Student;
import com.mycompany.myapp.service.dto.StudentDTO;
import java.util.Set;
import org.mapstruct.*;

/**
 * Mapper for the entity {@link Student} and its DTO {@link StudentDTO}.
 */
@Mapper(componentModel = "spring", uses = { UserClassMapper.class })
public interface StudentMapper extends EntityMapper<StudentDTO, Student> {
    @Mapping(target = "userClasses", source = "userClasses", qualifiedByName = "idSet")
    StudentDTO toDto(Student s);

    @Named("id")
    @BeanMapping(ignoreByDefault = true)
    @Mapping(target = "id", source = "id")
    StudentDTO toDtoId(Student student);

    @Named("idSet")
    @BeanMapping(ignoreByDefault = true)
    @Mapping(target = "id", source = "id")
    Set<StudentDTO> toDtoIdSet(Set<Student> student);

    @Mapping(target = "removeUserClass", ignore = true)
    Student toEntity(StudentDTO studentDTO);
}
